﻿using ARC.Yunpian.SMSService.Models.SimpleSmsModels;
using ARC.Yunpian.SMSService.Service.SimpleSmsService;
using System;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //TestAliYun();
            //TestYunPian();
            //TestYunXinShi();

            //CurrencyInterfaceSdkSmsClient client=new CurrencyInterfaceSdkSmsClient();
            //BaseResponse aa =  client.SendALiYunSimpleSms("123", "123", "123", "123", "");
        }

        static void TestYunXinShi()
        {
            ARC.YunXinShi.SMSService.Interfaces.ISimpleSms simple = new ARC.YunXinShi.SMSService.Service.SimpleSmsService.SimpleSms("arcsms-mic", "P@ssword01!");
            #region 添加普通模板
            //AddAndDeleAndUpdateSimpleTelResponse AddTemplate = simple.AddSimpleTemplate("测试：我是郝前程", "2");
            #endregion
            #region 删除普通模板
            //AddAndDeleAndUpdateSimpleTelResponse DeleteTemplate= simple.DeleteSimpleTemplate("","2","123");
            #endregion
            #region 修改普通模板
            //AddAndDeleAndUpdateSimpleTelResponse UpdateTemplate= simple.UpdateSimpleTemplate("123", "2", "1");
            #endregion
            #region 普通短信模板审核状态查询
            //QuerySimpleTelResponse QueryTemplate simple.QuerySimpleTemplate("1");
            #endregion
            #region 取短信模板记录
            //QuerySimpleTemplateReCodeResponse QueryReCode= simple.QueryTemplateReCode();
            #endregion
            #region 发送普通短信
            //BaseResponse SendR = simple.SendSimple("17600041028", "123", "1");
            #endregion
            #region 全文变量模板发送
            //BaseResponse Send= simple.SendSimple("17600041028", "123");
            #endregion
            #region 取已发送总条数
            //SendedSimpleResponse Count = simple.SendedSimpleCount("123");
            #endregion
            #region 获取状态短信接口
            //SendedSimpleStatusResponse sendStayus= simple.SendedSimpleStatus();
            #endregion
        }
        /// <summary>
        /// 云片测试
        /// </summary>
        static void TestYunPian()
        {
            string apikey = "aee59c8d641bd88562aad3db2a399571";
            Console.WriteLine("------------------------------普通短信---------------------------------");
            ARC.Yunpian.SMSService.Interfaces.ISimpleSms simple = new SimpleSms(apikey);
            #region 添加普通短信签名
            //AddSimpleSmsSinSuccessResponse AddSimple= simple.AddSimpleSinSms("郝前程123", 4, "123", "123");
            #endregion
            #region 查询普通短信签名状态
            //ARC.Yunpian.SMSService.Models.SimpleSmsModels.QuerySimpleSmsSinResponse querySign = simple.QuerySimpleSinSms("", 1, 10);
            #endregion
            #region 添加普通短信模板
            //AddAndDeleteSimpleSmsTelResponse AddTemplate= simple.AddSimpleTelelempleSms("【郝前程】123123", 3);
            #endregion
            #region 删除普通短信模板
            //AddAndDeleteSimpleSmsTelResponse delete= simple.DeleteSimpleTelemplateSms(4126180);
            #endregion
            #region 查询所有普通短信模板
            //List<QuerySimpleSmsTelTplIdResponse> alList= simple.QuerySimpleTeleplateSms();
            #endregion
            #region 查询指定模板
            //QuerySimpleSmsTelTplIdResponse queryOne =simple.QuerySimpleTeleplateSms(0);
            #endregion
            #region 批量发送多条普通短信
            //SendSimpleBatchResponse batchList = simple.SendSmsBatch("17600041028,18510020276", "【郝前程】祝您生日快乐。");
            #endregion
            #region 指定模板发送单条短信
            //SendSimpleResponse SendTelemplate= simple.JustTelempateSendSms("17600041028", "4126416", "#code#=123123123");
            #endregion
            #region 指定模板批量发送单条短信
            SendSimpleBatchResponse SendTelemplateBatch = simple.JustTelempateSendSmsBatch("17600041028,18510020276", "4126416", "#code#=123123123");


            #endregion
        }
        /// <summary>
        /// 阿里云测试
        /// </summary>
        static void TestAliYun()
        {

            Console.WriteLine("------------------------------普通短信---------------------------------");
            // ISimpleSms Simple = new SimpleSmsService("LTAI4GAaDQXbjMk2hBxS8Rqp", "SW6BMMkBbbY849C61KzPYKLlwJEQXj");
            #region 创建签名
            //Dictionary<string, string> file = new Dictionary<string, string>();
            //file.Add("123", "123123123");
            //AddAndDelSimpleSmsSingResponse json = Simple.AddSimpleSmsSign("测试", "0", "内部测试", file);
            #endregion
            #region 查询签名状态
            //QuerySimpleSmsSinResponse queryOne = Simple.QuerySimpleSmsSign("测试");
            #endregion
            #region 删除签名
            //AddAndDelSimpleSmsSingResponse dele= Simple.DeleteSimpleSmsSign("测试");
            #endregion
            #region 添加签名模板
            //AddAndDelSimpleSmsTemplateResponse AddTele= Simple.AddSimpleSmsTemplate(0, "测试", "123213123", "123");
            #endregion
            #region 删除模板
            //AddAndDelSimpleSmsTemplateResponse deletele= Simple.DeleteSimpleSmsTemplate("测试");
            #endregion
            #region 查询短信模板
            //QuerySimpleSmsTemplateResponse querySimpleSms = Simple.QuerySimpleSmsTemplate("SMS_205393642");
            #endregion
            #region 发送单条短信
            //SendSmsResponse SendOne= Simple.SendSimpleSms("17600041028", "北京安锐卓越信息技术股份", "SMS_205265246", "{code:1111}");
            #endregion
            #region 批量发送短信
            //var Punmbers=new List<string>()
            //{
            //    "17600041028",
            //    "18510020276"
            //};
            //var Signs=new List<string>()
            //{
            //    "北京安锐卓越信息技术股份",
            //    "北京安锐卓越信息技术股份"
            //};
            //List<Dictionary<string,string>> Parma=new List<Dictionary<string, string>>()
            //{
            //    new Dictionary<string, string>()
            //    {
            //        {"code","123456"},
            //        {"code","123"}
            //    },
            //    new Dictionary<string, string>()
            //    {
            //        {"code","123"},
            //        {"code","123456"}
            //    }
            //};
            //SendSmsResponse SendBatch= Simple.SendSimpleSmsBatch(Punmbers, Signs, "SMS_205265246", Parma);
            #endregion
            #region 普通短信发送短息记录
            //QuerySendSmsDetails querySendSmsDetails= Simple.QueryDigitalSendDetails("17600041028", "20201124", 5, 1);
            #endregion
            Console.WriteLine("------------------------------数字短信-----------------------------------");

            // IDigitalSms Digital = new DigitalSmsService("cn-hangzhou", "LTAI4GAaDQXbjMk2hBxS8Rqp", "SW6BMMkBbbY849C61KzPYKLlwJEQXj", "dysmsapi.aliyuncs.com", "2017-05-25");
            #region 创建模板
            //List<DigitalSmsAddTemFileArray> files=new List<DigitalSmsAddTemFileArray>()
            //{
            //    new DigitalSmsAddTemFileArray()
            //    {
            //        FileSuffix = "txt",
            //        Filename = "微信图片.txt",
            //        FileSize = "10241",
            //        FileContents = "123214dasfasdasd"
            //    }
            //};
            //AddAndDelDigitalTemResponse DigitalTemplate= Digital.AddDigitalTemplate("测试1", files, "测试用例");
            #endregion
            #region 删除数字模板
            //AddAndDelDigitalTemResponse DigitalRe= Digital.DeleDigitalTemplate("DIGITAL_SMS_205735257");
            #endregion
            #region 查询数字模状态
            //QueryDigitalTemResponse QueryRe= Digital.QueryDigitalTemplate("DIGITAL_SMS_205735257");
            #endregion
            #region 数字短信发送记录查询
            //QuerySendSmsDetails querySendDigital= Digital.QueryDigitalSendDetails("17600041028", "20201124", 5, 1);
            #endregion
            #region 发送数字短信
            // SendSmsResponse SendRe = Digital.SendDigitalSms("18510020276", "DIGITAL_SMS_205360625",
            // new Dictionary<string, string>());
            #endregion
            #region 批量发送数字短信
            //SendSmsResponse querySendBatch= Digital.SendDigitalSmsBatch(new List<string>() { "18510020276", "17600041028" }, "DIGITAL_SMS_205360625",
            //    new List<Dictionary<string, string>>());
            #endregion
        }
    }
}
